#!/bin/sh


if test "$1" != ""; then
	echo "Error: No arguments expected."
	echo
	exit 1;
fi

SYSTEM=`(uname -s) 2>/dev/null`
RELEASE=`(uname -r) 2>/dev/null`
MACHINE=`(uname -m) 2>/dev/null`
VERSION=`(uname -v) 2>/dev/null`

echo
echo "Platform:	$SYSTEM on $MACHINE"
echo "$SYSTEM version:	$RELEASE"
echo "$SYSTEM release:	$VERSION"
echo
echo


##La máquina detectada depende del sistema operativo instalado, se detecta un x86 de 32 bits
##si el OS es de 32 bits, aunque se trate de un x86_64 de 64 bits.


#R3000 machines.
if test "$MACHINE" = "pmax" -a "$SYSTEM" = "NetBSD" ; then

	exit 100


#AMD\Intel 64 bits machines.
elif test "$SYSTEM" = "Linux" -a "$MACHINE" = "x86_64" ; then

	exit 200

#x86 machines.
elif test "$SYSTEM" = "Linux" -a `echo $MACHINE | grep -c "86"` = 1  ; then

	exit 201

else

	echo "Platform not supported."
	echo
	exit 3

fi
